import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class liso here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class liso extends piso
{
   /**
     * Act - do whatever the liso wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
   private int reg;
    /**
     * Constructor
     * @param Recibe el tipo de piso que se quiere colocar
     */
    public liso(int dato)
    {
        setImage("piso_liso"+dato+".png");
        reg=dato;
    }
    
    public void act() 
    {
        // Add your action code here.
        if(reg==2)
         muevePiso();
        if(reg==7||reg==8)
         muevePiso();
    }    
    /**
     * muevePiso Metodo que se encarga de colocar el piso y moverlo 
     */
    private void muevePiso()
    {
     if(reg==2)  
     if(getX()<=455)
     move(5);
     
     if(reg==7||reg==8)
     if(getX()<=340)
     move(10);
    }
}
